home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / PInterfaces / DisAsmLookup.p < prev    next >
Encoding:
Text File  |  1992-01-29  |  22.6 KB  |  481 lines  |  [TEXT/MPS ]

  1. {
  2.     Created: Wednesday, November 1, 1989
  3.     DisAsmLookup.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.     Copyright Apple Computer, Inc.    1987-1991
  7.     All rights reserved
  8. }
  9.  
  10. {$IFC UNDEFINED UsingIncludes}
  11. {$SETC UsingIncludes := 0}
  12. {$ENDC}
  13.  
  14. {$IFC NOT UsingIncludes}
  15.     UNIT DisAsmLookup;
  16.     INTERFACE
  17. {$ENDC}
  18.  
  19. {$IFC UNDEFINED UsingDisAsmLookup}
  20. {$SETC UsingDisAsmLookup := 1}
  21.  
  22. {$I+}
  23. {$SETC DisAsmLookupIncludes := UsingIncludes}
  24. {$SETC UsingIncludes := 1}
  25. {$IFC UNDEFINED UsingTypes}
  26. {$I $$Shell(PInterfaces)Types.p}
  27. {$ENDC}
  28. {$SETC UsingIncludes := DisAsmLookupIncludes}
  29.  
  30.  
  31. TYPE
  32.     LookupRegs    = (_A0_, _A1_, _A2_, _A3_, _A4_, _A5_, _A6_, _A7_,
  33.                                  _PC_, _ABS_, _TRAP_, _IMM_);
  34.  
  35. (*----------------------------------------------------------------------*)
  36.  
  37. PROCEDURE Disassembler(      DstAdjust:  LongInt;                  {addr correction}
  38.                                              VAR BytesUsed:  Integer;                  {bytes used up  }
  39.                                                      FirstByte:  UNIV Ptr;                 {starting byte  }
  40.                                              VAR Opcode:         UNIV Str255;          {mnemonic             }
  41.                                              VAR Operand:      UNIV Str255;        {operand        }
  42.                                              VAR Comment:      UNIV Str255;          {comment        }
  43.                                                      LookupProc: UNIV Ptr);              {search proc    }
  44.     (*
  45.      Disassembler is a Pascal routine to be called to disassemble a sequence
  46.      of bytes.  All MC68xxx, MC68881, and MC68851 instructions are supported.
  47.      The sequence of bytes to be disassembled are pointed to by FirstByte.
  48.      BytesUsed bytes starting at FirstByte are consumed by the disassembly,
  49.      and the Opcode, Operand, and Comment strings returned as NULL TERMINATED
  50.      Pascal strings (for easier manipulation with C). The caller is then free
  51.      to format or use the output strings any way appropriate to the
  52.      application.
  53.      
  54.      Depending on the opcode and effective address(s) (EA's) to be
  55.      disassembled, the Opcode, Operand, and Comment strings contain the
  56.      following information:
  57.      
  58.      Case                     Opcode    Operand    Comment
  59.      =======================================================================
  60.      Non PC-relative EA's     op.sz     EA's             ; 'c…' (for immediates)
  61.      PC-relative EA's         op.sz     EA's       ; address
  62.      Toolbox traps            DC.W      $AXXX      ; TB XXXX
  63.      OS traps                 DC.W      $AXXX      ; OS XXXX
  64.      Invalid bytes            DC.W      $XXXX      ; ????
  65.      =======================================================================
  66.      
  67.      For valid disassembly of processor instructions the appropriate MC68XXX
  68.      opcode mnemonic is generated for the Opcode string along with a size
  69.      attribute when required.  The source and destination EA's are generated
  70.      as the Operand along with a possible comment. Comments start with a ';'.
  71.      Traps use a DC.W assembler directive as the Opcode with the trap word
  72.      as the Operand and a comment indicating whether the trap is a toolbox or
  73.      OS trap and what the trap number is.  As described later the caller can
  74.      generate symbolic substitutions into EA's and provide names for traps.
  75.     
  76.      Invalid instructions cause the string 'DC.W' to be returned in the
  77.      Opcode string. Operand is '$XXXX' (the invalid word) with a comment of
  78.      '; ????'.  BytesUsed is 2.  This is similar to the trap call case except
  79.      for the comment.
  80.     
  81.      Note, the Operand EA's is syntatically similar to but NOT COMPATIBLE
  82.      with the MPW assembler!    This is because the Disassembler generates
  83.      byte hex constants as "$XX" and word hex constants as "$XXXX".  Negative
  84.      values (e.g., $FF or $FFFF) produced by the Disassembler are treated as
  85.      long word values by the MPW assembler.  Thus it is assumed that
  86.      Disassembler output will NOT be used as MPW assembler input.  If that is
  87.      the goal, then the caller must convert strings of the form $XX or $XXXX
  88.      in the Operand string to their decimal equivalent.  The routine
  89.      ModifyOperand is provided in this unit to aid with the conversion
  90.      process.
  91.     
  92.      Since a PC-relative comment is an address, the only address that the
  93.      Disassembler knows about is the address of the code pointed to by
  94.      FirstByte.  Generally, that may be a buffer that has no relation to
  95.      "reality", i.e., the actual code loaded into the buffer.  Therefore,
  96.      to allow the address comment to be mapped back to some actual address
  97.      the caller may specify an adjustment factor, specified by DstAdjust,
  98.      that is ADDED to the value that normally would be placed in the
  99.      comment.
  100.     
  101.      Operand effective address strings are generated as a function of the 
  102.      effective address mode and a special case is made for A-trap opcode
  103.      strings. In places where a possible symbolic reference could be
  104.      substituted for an address (or a portion of an address), the Disassembler
  105.      can call a user specified routine to do the substitution (using the
  106.      LookupProc parameter described later).  The following table summarizes
  107.      the generated effective addresses and where symbolic substitutions (S)
  108.      can be made:
  109.      
  110.      Mode    Generated Effective Address  Effective Address with Substitution
  111.      ========================================================================
  112.          0     Dn                           Dn
  113.          1     An                           An
  114.          2     (An)                         (An)
  115.          3     (An)+                        (An)+
  116.          4     -(An)                        -(An)
  117.          5     ∂(An)                        S(An) or just S (if An=A5, ∂≥0)
  118.         6n     ∂(An,Xn.Size*Scale)          S(An,Xn.Size*Scale)
  119.         6n     (BD,An,Xn.Size*Scale)        (S,An,Xn.Size*Scale)
  120.         6n     ([BD,An],Xm.Size*Scale,OD)   ([S,An],Xm.Size*Scale,OD)
  121.         6n     ([BD,An,Xn.Size*Scale],OD)   ([S,An,Xn.Size*Scale],OD)
  122.         70     ∂                            S
  123.         71     ∂                            S
  124.         72     *±∂                          S
  125.         73     *±∂(Xn.Size*Scale)           S(Xn.Size*Scale)
  126.         73     (*±∂,Xn.Size*Scale)          (S,Xn.Size*Scale)
  127.         73     ([*±∂],Xm.Size*Scale,OD)     ([S],Xm.Size*Scale,OD)
  128.         73     ([*±∂,Xn.Size*Scale],OD)     ([S,Xn.Size*Scale],OD)
  129.         74     #data                        S (#data made comment)
  130.      A-traps $AXXX                        S (as opcode, AXXX made comment)
  131.      ========================================================================
  132.  
  133.      For A-traps, the substitution can be performed to substitute for the DC.W
  134.      opcode string.  If the substitution is made then the Disassembler will
  135.      generate ,Sys and/or ,Immed flags as operands for Toolbox traps and
  136.      ,AutoPop for OS traps when the bits in the trap word indicates these
  137.      settings.
  138.      
  139.                      |         Generated          |            Substituted
  140.                      | Opcode  Operand  Comment   | Opcode  Operand        Comment
  141.      ========================================================================
  142.      Toolbox | DC.W    $AXXX    ; TB XXXX | S       [,Sys][,Immed] ; AXXX
  143.      OS      | DC.W    $AXXX    ; OS XXXX | S       [,AutoPop]     ; AXXX
  144.      ========================================================================
  145.  
  146.      All displacements (∂, BD, OD) are hexadecimal values shown as a byte
  147.      ($XX), word ($XXXX), or long ($XXXXXXXX) as appropriate.  The *Scale is
  148.      suppressed if 1. The Size is W or L.  Note that effective address
  149.      substitutions can only be made for "∂(An)", "BD,An", and "*±∂" cases.
  150.     
  151.      For all the effective address modes 5, 6n, 7n, and for A-traps, a
  152.      coroutine (a procedure) whose address is specified by the LookupProc
  153.      parameter is called by the Disassembler (if LookupProc is not NIL) to
  154.      do the substitution (or A-trap comment) with a string returned by the
  155.      proc.  It is assumed that the proc pointed to by LookupProc is a level 1
  156.      Pascal proc declared as follows:
  157.  
  158.      PROCEDURE Lookup(        PC:      UNIV Ptr;     {Addr of extension/trap word}
  159.                                                 BaseReg: LookupRegs;   {Base register/lookup mode  }
  160.                                                 Opnd:    UNIV LongInt; {Trap word, PC addr, disp.  }
  161.                                         VAR S:       Str255);          {Returned substitution      }
  162.  
  163.      or in C,
  164.      
  165.      pascal void LookUp(Ptr         PC,      /* Addr of extension/trap word */
  166.                                             LookupRegs  BaseReg, /* Base register/lookup mode   */
  167.                                             long        Opnd,    /* Trap word, PC addr, disp.   */
  168.                                             char              *S);     /* Returned substitution       */
  169.     
  170.      PC      = Pointer to instruction extension word or A-trap word in the
  171.                          buffer pointed to by the Disassembler's FirstByte parameter.
  172.  
  173.      BaseReg = This determines the meaning of the Opnd value and supplies
  174.                          the base register for the "∂(An)", "BD,An", and "*±∂" cases.
  175.                          BaseReg may contain any one of the following values:
  176.                         
  177.                          _A0_    =  0 ==> A0
  178.                          _A1_    =  1 ==> A1
  179.                          _A2_    =  2 ==> A2
  180.                          _A3_    =  3 ==> A3
  181.                          _A4_    =  4 ==> A4
  182.                          _A5_    =  5 ==> A5
  183.                          _A6_    =  6 ==> A6
  184.                          _A7_    =  7 ==> A7
  185.                          _PC_    =  8 ==> PC-relative (special case)
  186.                          _ABS_   =  9 ==> Abs addr    (special case)
  187.                          _TRAP_  = 10 ==> Trap word   (special case)
  188.                          _IMM_     = 11 ==> Immediate   (special case)
  189.                          
  190.                          For absolute addressing (modes 70 and 71), BaseReg contains
  191.                          _ABS_.  For A-traps, BaseReg would contain _TRAP_.  For
  192.                          immediate data (mode 74), BaseReg would contain _IMM_.
  193.      
  194.      Opnd    = The contents of this LongInt is determined by the BaseReg
  195.                          parameter just described.
  196.  
  197.                          For BaseReg = _IMM_ (immediate data):
  198.                                  Opnd contains the (extended) 32-bit immediate data specified
  199.                                  by the instruction.
  200.  
  201.                          For BaseReg = _TRAP_ (A-traps):
  202.                                  Opnd is the entire trap word. The high order 16 bits of
  203.                                  Opnd are zero.
  204.  
  205.                          For BaseReg = _ABS_  (absolute effective address):
  206.                                  Opnd contains the (extended) 32-bit address specifed by
  207.                                  the instruction's effective address.  Such addresses would
  208.                                  generally be used to reference low memory globals on a
  209.                                  Macintosh.
  210.  
  211.                          For BaseReg = _PC_  (PC-relative effective address):
  212.                                  Opnd contains the 32-bit address represented by "*±∂"
  213.                                  adjusted by the Disassembler's DstAdjust parameter.
  214.                                  
  215.                          For BaseReg = _An_  (effective address with a base register):
  216.                                  Opnd contains the (sign-extended) 32-bit (base)
  217.                                  displacement from the instruction's effective address.
  218.                                  
  219.                                  In the Macintosh environment, a BaseReg specifying A5
  220.                                  implies either global data references or Jump Table
  221.                                  references. Positive Opnd values with an A5 BaseReg thus
  222.                                  mean Jump Table references, while a negative offset would
  223.                                  mean a global data reference.  Base registers of A6 or A7
  224.                                  would usually mean local data.
  225.     
  226.      S       = Pascal string returned from Lookup containing the effective
  227.                          address substitution string or a trap name for A-traps.  S is
  228.                          set to null PRIOR to calling Lookup.  If it is still null on
  229.                          return, the string is not used.  If not null, then for A-traps,
  230.                          the returned string is used as the opcode string. In all other
  231.                          cases the string is substituted as shown in the above table.
  232.     
  233.      Depending on the application, the caller has three choices on how to
  234.      use the Disassembler and an associated Lookup proc:
  235.     
  236.      (1). The caller can call just the Disassembler and provide his own Lookup
  237.                 proc. In that case the calling conventions discussed above must be
  238.                 followed.
  239.     
  240.      (2). The caller can provide NIL for the LookupProc parameter, in which
  241.                 case, NO Lookup proc will be called.
  242.                 
  243.      (3). The caller can call first InitLookup (described below, a proc
  244.                 provided with this unit) and pass the address of this unit's
  245.                 standard Lookup proc when Disassembler is called.    In this case all
  246.                 the control logic to determine the kind of substitution to be done
  247.                 is provided for the caller and all that need to be provided by the
  248.                 user are routines to look up any or all of the following:
  249.                 
  250.                 • PC-relative references
  251.                 • Jump Table references
  252.                 • Absolute address references
  253.                 • Trap names
  254.                 • Immediate data names
  255.                 • References with offsets from base registers                                            *)
  256.                 
  257.  
  258. PROCEDURE InitLookup(PCRelProc, JTOffProc, TrapProc, AbsAddrProc, IdProc, ImmDataProc: UNIV Ptr);
  259.     {Prepare for use of this unit's Lookup proc.  When Disassembler is called
  260.      and the address of this unit's Lookup proc is specified, then for immediate
  261.      data, PC-relative, Jump Table references, A-traps, absolute addresses, and
  262.      offsets from a base register, the associated level 1 Pascal proc
  263.      specified here is called (if not NIL -- all six addresses are preset to
  264.      NIL).  The calls assume the following declarations for these procs (see
  265.      Lookup, below for further details):
  266.                                                      
  267.      PROCEDURE PCRelProc(Address: UNIV LongInt; 
  268.                                              VAR S:      UNIV Str255);
  269.  
  270.      PROCEDURE JTOffProc(A5JTOffset: UNIV Integer;
  271.                                              VAR S:         UNIV Str255);
  272.  
  273.      PROCEDURE TrapNameProc(TrapWord: UNIV Integer;
  274.                                                     VAR S:      UNIV Str255);
  275.                                                      
  276.      PROCEDURE AbsAddrProc(AbsAddr: UNIV LongInt;
  277.                                                  VAR S:      UNIV Str255);
  278.  
  279.      PROCEDURE IdProc(BaseReg: LookupRegs;
  280.                                         Offset:  UNIV LongInt;
  281.                                         VAR S:     UNIV Str255);
  282.                                                      
  283.      PROCEDURE ImmDataProc(ImmData: UNIV LongInt;
  284.                                                  VAR S:      UNIV Str255);
  285.  
  286.      Note: InitLookup contains initialized data which requires initializing
  287.                  at load time (this is of concern only to users with assembler
  288.                  main programs.}
  289.     
  290.  
  291.  PROCEDURE Lookup(        PC:      UNIV Ptr;     {Addr of extension/trap word}
  292.                                             BaseReg: LookupRegs;   {Base register/lookup mode  }
  293.                                             Opnd:    UNIV LongInt; {Trap word, PC addr, disp.  }
  294.                                     VAR S:       Str255);          {Returned substitution      }
  295.     {This is a standard Lookup proc available to the caller for calls to the
  296.      Disassembler.    If the caller elects to use this proc, then InitLookup
  297.      MUST be called prior to any calls to the Disassembler.  All the logic
  298.      to determine the type of lookup is done by this proc.  For PC-relative,
  299.      Jump Table references, A-traps, absolute addresses, and offsets from a
  300.      base register, the associated level 1 Pascal proc specified in the
  301.      InitLookup call (if not NIL) is called.
  302.     
  303.      This scheme simplifies the Lookup mechanism by allowing the caller
  304.      to deal with just the problems related to the application.}
  305.  
  306.  
  307. PROCEDURE LookupTrapName(TrapWord: UNIV Integer;
  308.                                                  VAR S:       UNIV Str255);
  309.     {This is a procedure provided to allow conversion of a trap instruction
  310.      (in TrapWord) to its corresponding trap name (in S).  It is provided
  311.      primarily for use with the Disassembler and its address may be passed to
  312.      InitLookup above for use by this unit's Lookup routine.  Alternatively,
  313.      there is nothing prohibiting the caller from using it directly for other
  314.      purposes or by some other Lookup proc.
  315.      
  316.      Note: The tables in this proc make the size of this proc about 9500
  317.                  bytes.  The trap names are fully spelled out in upper and lower
  318.                  case.}
  319.  
  320. PROCEDURE ModifyOperand(VAR Operand: UNIV Str255);
  321.     {Scan an operand string, i.e., the null terminated Pascal string returned
  322.      by the Disassembler (null MUST be present here) and modify negative hex
  323.      values to negated positive value.  For example, $FFFF(A5) would be
  324.      modified to -$0001(A5).  The operand to be processed is    passed as the
  325.      function's parameter which is edited "in place" and returned to the
  326.      caller.
  327.  
  328.      This routine is essentially a pattern matcher and attempts to only
  329.      modify 2, 4, and 8 digit hex strings in the operand that "might" be
  330.      offsets from a base register.  If the matching tests are passed, the
  331.      same number of original digits are output (because that indicates a
  332.      value's size -- byte, word, or long).
  333.  
  334.      For a hex string to be modified, the following tests must be passed:
  335.  
  336.      • There must have been exactly 2, 4, or 8 digits.
  337.  
  338.          Only hex strings $XX, $XXXX, and $XXXXXXXX are possible candidates
  339.          because that is the only way the Disassembler generates offsets.
  340.  
  341.      • Hex string must be delimited by a "(" or a ",".
  342.  
  343.          The "(" allows offsets for $XXXX(An,...) and $XX(An,Xn) addressing
  344.          modes.  The comma allows for the MC68020 addressing forms.
  345.  
  346.      • The "$X..." must NOT be preceded by a "±".
  347.  
  348.          This eliminates the possibility of modifying the offset of a
  349.          PC-relative addressing mode always generated in the form "*±$XXXX".
  350.      
  351.      • The "$X..." must NOT be preceded by a "#".
  352.      
  353.          This eliminates modifying immediate data.
  354.  
  355.      • Value must be negative.
  356.  
  357.          Negative values are the only values we modify.  A value $FFFF is
  358.          modified to -$0001.}
  359.  
  360. FUNCTION validMacsBugSymbol(symStart, limit: UNIV Ptr;
  361.                                                         symbol: StringPtr): StringPtr; C;
  362.     {Check that the bytes pointed to by symStart represents a valid MacsBug
  363.      symbol.  The symbol must be fully contained in the bytes starting at
  364.      symStart, up to, but not including, the byte pointed to by the limit
  365.      parameter.
  366.      
  367.      If a valid symbol is NOT found, then NIL is returned as the function's
  368.      result.  However, if a valid symbol is found, it is copied to symbol (if
  369.      it is not NIL) as a null terminated Pascal string, and return a pointer
  370.      to where we think the FOLLOWING module begins. In the "old style" cases
  371.      (see below) this will always be 8 or 16 bytes after the input symStart.
  372.      For new style Apple Pascal and C cases this will depend on the symbol
  373.      length, existence of a pad byte, and size of the constant (literal) area.
  374.      In all cases, trailing blanks are removed from the symbol.
  375.      
  376.      A valid MacsBug symbol consists of the characters '_', '%', spaces,
  377.      digits, and upper/lower case letters in a format determined by the first
  378.      two bytes of the symbol as follows:
  379.      
  380.         1st byte  | 2nd byte  |  Byte  |
  381.             Range   |  Range    | Length | Comments
  382.      =======================================================================
  383.         $20 - $7F | $20 - $7F |    8   | "Old style" MacsBug symbol format
  384.         $A0 - $7F | $20 - $7F |    8   | "Old style" MacsBug symbol format
  385.      -----------------------------------------------------------------------
  386.         $20 - $7F | $80 - $FF |   16   | "Old style" MacApp symbol ab==>b.a
  387.         $A0 - $7F | $80 - $FF |   16   | "Old style" MacApp symbol ab==>b.a
  388.      -----------------------------------------------------------------------
  389.         $80       | $01 - $FF |    n   | n = 2nd byte           (Apple symbol)
  390.         $81 - $9F | $00 - $FF |    m   | m = BAnd(1st byte,$7F) (Apple symbol)
  391.      =======================================================================
  392.      
  393.      The formats are determined by whether bit 7 is set in the first and
  394.      second bytes.  This bit will removed when we find it or'ed into the first
  395.      and/or second valid symbol characters.
  396.      
  397.      The first two formats in the above table are the basic "old style" (pre-
  398.      existing) MacsBug formats. The first byte may or may not have bit 7 set
  399.      the second byte is a valid symbol character.  The first byte (with bit 7
  400.      removed) and the next 7 bytes are assumed to comprise the symbol.
  401.      
  402.      The second pair of formats are also "old style" formats, but used for
  403.      MacApp symbols.  Bit 7 set in the second character indicates these
  404.      formats.  The symbol is assumed to be 16 bytes with the second 8 bytes
  405.      preceding the first 8 bytes in the generated symbol.  For example,
  406.      12345678abcdefgh represents the symbol abcdefgh.12345678.
  407.      
  408.      The last pair of formats are reserved by Apple and generated by the MPW
  409.      Pascal and C compilers.  In these cases the value of the first byte is
  410.      always between $80 and $9F, or with bit 7 removed, between $00 and $1F.
  411.      For $00, the second byte is the length of the symbol with that many bytes
  412.      following the second byte (thus a max length of 255). Values $01 to $1F
  413.      represent the length itself.  A pad byte may follow these variable length
  414.      cases if the symbol does not end on a word boundary.  Following the
  415.      symbol and the possible pad byte is a word containing the size of the
  416.      constants (literals) generated by the compiler.
  417.      
  418.      Note that if symStart actually does point to a valid MacsBug symbol,
  419.      then you may use showMacsBugSymbol to convert the MacsBug symbol bytes to
  420.      a string that could be used as a DC.B operand for disassembly purposes.
  421.      This string explicitly shows the MacsBug symbol encodings.}
  422.  
  423. FUNCTION endOfModule(address, limit: UNIV Ptr; symbol: StringPtr;
  424.                                          VAR nextModule: UNIV Ptr): StringPtr; C;
  425.     {Check to see if the specified memory address, contains a RTS, JMP (A0) or
  426.      RTD #n instruction immediately followed by a valid MacsBug symbol.  These
  427.      sequences are the only ones which can determine an end of module when
  428.      MacsBug symbols are present.  During the check, the instruction and its
  429.      following MacsBug symbol must be fully contained in the bytes starting at
  430.      the specified address parameter, up to, but not including, the byte
  431.      pointed to by the limit parameter.
  432.     
  433.      If the end of module is NOT found, then NIL is returned as the
  434.      function's result.  However, if a end of module is found, the MacsBug
  435.      symbol is returned in symbol (if it is not NIL) as a null terminated
  436.      Pascal string (with trailing blanks removed), and the functions returns
  437.      the pointer to the start of the MacsBug symbol (i.e., address+2 for RTS
  438.      or JMP (A0) and address+4 for RTD #n).  This address may then be used as
  439.      in input parameter to showMacsBugSymbol to convert the MacsBug symbol to
  440.      a Disassembler operand string.
  441.      
  442.      Also returned in nextModule is where we think the FOLLOWING module
  443.      begins. In the "old style" cases (see validMacsBugSymbol) this will
  444.      always be 8 or 16 bytes after the input address.  For new style the
  445.      Apple Pascal and C cases this will depend on the symbol length, existence
  446.      of a pad byte, and size of the constant (literal) area.  See 
  447.      validMacsBugSymbol for a description of valid MacsBug symbol formats.}
  448.     
  449. FUNCTION showMacsBugSymbol(symStart, limit: UNIV Ptr; operand: StringPtr;
  450.                                                      VAR bytesUsed: Integer): StringPtr; C;
  451.     {Format a MacsBug symbol as a operand of a DC.B directive.  The first one
  452.      or two bytes of the symbol are generated as $80+'c' if they have there
  453.      high high bits set.  All other characters are shown as characters in a
  454.      string constant.  The pad byte, if present, is one is also shown as $00.
  455.      
  456.      When called, showMacsBugSymbol assumes that symStart is pointing at a
  457.      valid MacsBug symbol as validated by the validMacsBugSymbol or
  458.      endOfModule routines. As with validMacsBugSymbol, the symbol must be
  459.      fully contained in the bytes starting at symStart up to, but not
  460.      including, the byte pointed to by the limit parameter.
  461.      
  462.      The string is returned in the 'operand' parameter as a null terminated
  463.      Pascal string.  The function also returns a pointer to this string as its
  464.      return value (NIL is returned only if the byte pointed to by the limit
  465.      parameter is reached prior to processing the entire symbol -- which
  466.      should not happen if properly validated).  The number of bytes used for
  467.      the symbol is returned in bytesUsed.  Due to the way MacsBug symbols are
  468.      encoded, bytesUsed may not necessarily be the same as the length of the
  469.      operand string.
  470.      
  471.      A valid MacsBug symbol consists of the characters '_', '%', spaces,
  472.      digits, and upper/lower case letters in a format determined by the first
  473.      two bytes of the symbol as described in the validMacsBugSymbol routine.}
  474.  
  475. {$ENDC}    { UsingDisAsmLookup }
  476.  
  477. {$IFC NOT UsingIncludes}
  478.     END.
  479. {$ENDC}
  480.  
  481.